﻿#region Imports
using System.Collections.ObjectModel;
using System.Linq;
using System.Windows.Input;
using CommonUtilities.Util;
using SeriesEpisodeMapper.Models;
#endregion Imports

namespace SeriesEpisodeMapper.ViewModels
{
    public class DelimeterSelectorViewModel : BaseViewModel
    {
        #region Command declarations
        public ICommand SaveDelimeterCommand { get; internal set; }
        public ICommand LoadSourceCommand { get; internal set; }
        #endregion Command declarations

        #region Properties
        public ObservableCollection<DelimeterInfo> AllDataDelimeter { get; set; }
        public ObservableCollection<DelimeterInfo> AllFieldDelimeter { get; set; }

        public DelimeterInfo SelectedDataDelimeter { get; set; }
        public DelimeterInfo SelectedFieldDelimeter { get; set; }
        #endregion Properties

        #region Constructors
        public DelimeterSelectorViewModel()
        {
            ObservableCollection<DelimeterInfo> allDataDelimeter = new ObservableCollection<DelimeterInfo>();
            allDataDelimeter.Add(new DelimeterInfo { Description = "Comma", Delimeter = "," });
            allDataDelimeter.Add(new DelimeterInfo { Description = "Tab", Delimeter = "\t", DelimeterHint = @"\t" });
            //allDataDelimeter.Add(new DelimeterInfo { Description = "Colon", Delimeter = ":" });
            //allDataDelimeter.Add(new DelimeterInfo { Description = "Semicolon", Delimeter = ";" });
            AllDataDelimeter = allDataDelimeter;

            ObservableCollection<DelimeterInfo> allFieldDelimeter = new ObservableCollection<DelimeterInfo>();
            allFieldDelimeter.Add(new DelimeterInfo { Description = "Quotation mark", Delimeter = @"""" });
            allFieldDelimeter.Add(new DelimeterInfo { Description = "Single Quotation mark", Delimeter = "'" });
            allFieldDelimeter.Add(new DelimeterInfo { Description = "None" });
            AllFieldDelimeter = allFieldDelimeter;

            SelectedDataDelimeter = AllDataDelimeter.FirstOrDefault();
            SelectedFieldDelimeter = AllFieldDelimeter.FirstOrDefault();
        }
        #endregion Constructors
    }
}
